
// 计算
function calculate(){
    var wkt = $('#wkt').val();
    if(wkt){
        if(wkt.indexOf('POLYGON') >= 0){
            var json = parse(wkt);
            console.log(json);
            var polygon = turf.polygon(json.coordinates);
            var area = turf.area(polygon);
            console.log(area);
        }else{
            alert('仅支持POLYGON 和 MULTIPOLYGON计算');
        }
    }else{
        alert('请输入wkt');
    }
}